<?php
$route->any('login', 'AuthController@login')->name('admin.user.login');

$route->any('qiniu/callback', 'QiNiuController@callback');

//type
$route->get('type/index', 'TypeController@index')->name('admin.type.index');

$route->group(['middleware' => 'api.auth'], function ($route) {
    //管理员
    $route->get('admin/index', 'AdminController@index')->name('admin.admin.index');
    $route->any('admin/info', 'AdminController@info');
    $route->any('admin/destroy', 'AdminController@destroy');
    $route->get('logout', 'AdminController@logout')->name('admin.admin.logout');
    $route->post('admin/store', 'AdminController@store')->name('admin.admin.store');
    $route->post('password/update', 'AdminController@updatePwd')->name('admin.password.update');
    $route->any('reset/password', 'AdminController@resetPassword');

    //car
    $route->any('car/import', 'CarController@import');
    $route->any('car/index', 'CarController@index');
    $route->any('car/info', 'CarController@info');
    $route->any('car/clear', 'CarController@clear');
    $route->any('car/store', 'CarController@store');
    $route->any('car/destroy', 'CarController@destroy');
    $route->any('car/publish', 'CarController@publish');
    $route->any('car/flow', 'CarController@flow');
    $route->any('car/clear/future', 'CarController@clear_future');

    $route->any('car/appoint/index', 'CarController@appoint_index');
    $route->any('car/loan/index', 'CarController@load_index');

    //user
    $route->any('user/index', 'UserController@index');
    $route->any('user/store', 'UserController@store');
    $route->any('user/info', 'UserController@info');
    $route->any('user/destroy', 'UserController@destroy');
    $route->any('user/clear/punish', 'UserController@clearPunish');
    $route->any('user/update/punish', 'UserController@updatePunish');
    $route->any('user/update/notice', 'UserController@updateNotice');

    //site
    $route->any('site', 'ConfigController@site');
    $route->any('site/store', 'ConfigController@store');

    //credit
    $route->any('credit/index', 'CreditController@index');

});

